<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('gift/index')}">礼物列表</a></li>
			<li><a href="{:url('gift/add')}">礼物添加</a></li>
			<li class="active"><a href="{:url('gift/add')}">礼物修改</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('gift/editpost')}">
			<div class="form-group">
				<label for="input-g_name" class="col-sm-2 control-label"><span class="form-required">*</span>礼物名称</label>
				<div class="col-md-6 col-sm-10">
					<input type="hidden" name="id" value="{$gift.id}">
					<input type="text" class="form-control" id="input-g_name" name="g_name" value="{$gift.g_name}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_sponsor" class="col-sm-2 control-label"><span class="form-required">*</span>赞助商</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-g_sponsor" name="g_sponsor" value="{$gift.g_sponsor}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_password" class="col-sm-2 control-label"><span class="form-required">*</span>兑换密码</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-g_password" name="g_password" max="999999" min="100000" value="{$gift.g_password}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_phone" class="col-sm-2 control-label"><span class="form-required">*</span>联系电话</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-g_phone" name="g_phone" value="{$gift.g_phone}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_url" class="col-sm-2 control-label"><span class="form-required">*</span>兑换网址</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-g_url" name="g_url" value="{$gift.g_url}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_total" class="col-sm-2 control-label">当前总数</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-g_total" value="{$gift.g_total}" disabled>
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_use" class="col-sm-2 control-label">已用数量</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-g_use" value="{$gift.g_use}" disabled>
				</div>
			</div>
			<div class="form-group">
				<label for="input-add" class="col-sm-2 control-label">增加礼品</label>
				<div class="col-md-6 col-sm-10">
					<input type="number" class="form-control" id="input-add" name="add" value="0" max="10000" min="0">
				</div>
			</div>
			<div class="form-group">
				<label for="input-g_validtime" class="col-sm-2 control-label"><span class="form-required">*</span>有效期</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control js-bootstrap-datetime" id="input-g_validtime" name="g_validtime" value="{:substr($gift.g_validtime,0,16)}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-s_status" class="col-sm-2 control-label"><span class="form-required">*</span>状态</label>
				<div class="col-md-6 col-sm-10" id="input-s_status">
					<select class="form-control" name="g_status">
						<option value="10" <if condition="$gift['g_status'] eq 10" >selected </if>>启用</option>
                        <option value="20" <if condition="$gift['g_status'] eq 20" >selected </if>>停用</option>
					</select>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">修改</button>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>